package xyz.lilei123.demo.controller;

import org.jboss.jandex.Index;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import xyz.lilei123.demo.index.constants.IndexEnum;
import xyz.lilei123.demo.index.dto.BuildDto;


/**
 * @author jack
 * @version 1.0
 * @date 25/01/2022 16:17
 **/
@RestController
@RequestMapping("/index")
public class IndexController {


    @PostMapping(value="/build")
    public void build(@RequestBody BuildDto buildDto) {
        IndexEnum.valueOf(buildDto.getIndexName()).getBuildService().build(buildDto.getStart(), buildDto.getEnd());
    }
    
}
